(define-module (utils string))


(define-public (stringify sth)
  (cond
   [(number? sth) (number->string sth)]
   [(string? sth) sth]
   [else (simple-format #f "~s" sth)]))


(define-public n-times-string
  (lambda* (string-to-repeat times)
    (let loop ([remaining-times times] [result ""])
      (cond
       [(zero? remaining-times) result]
       [else
        (loop (- remaining-times 1)
              (string-append result string-to-repeat))]))))
